export const notifyMe = () => {
    // 先检查浏览器是否支持
    if (!("Notification" in window)) {
        alert("This browser does not support desktop notification");
    }
    // 检查用户是否同意接受通知
    else if (Notification.permission === "granted") {
        let notification = new Notification("IT智慧运维平台",{lang:'zh',dir:'auto',body:'紧急告警',requireInteraction:true,timestamp:Math.floor(Date.now())});
    }
    // 否则我们需要向用户获取权限
    else if (Notification.permission !== "denied") {
        Notification.requestPermission().then((permission) => {
            // 如果用户接受权限，我们就可以发起一条消息
            if (permission === "granted") {
                let notification = new Notification("IT智慧运维平台",{lang:'zh',dir:'auto',body:'紧急告警',requireInteraction:true,timestamp:Math.floor(Date.now())});
            }
            // ,requireInteraction:true
        })
    }
}